<template>
  <svg :class="[svgClass,defaultClass]" aria-hidden="true">
    <use :xlink:href="iconName"></use>
  </svg>
</template>

<script>
  export default {
    name: 'svgIcon',
    props: {
      iconClass: {
        type: String,
        required: true
      },
      className: {
        type: String
      },
      size: {
        type: String,
        default: 'normal'
      },

    },
    computed: {
      iconName() {
        return `#icon-${this.iconClass}`
      },
      svgClass() {
        if (this.className) {
          return 'svg-icon ' + this.className
        } else {
          return 'svg-icon'
        }
      },
      defaultClass () {
        if (this.iconClass === 'designer') {return 'designer'}
        else {
          return ''
        }
      }
    }
  }
</script>

<style scoped lang="scss">
  .svg-icon {
    fill: currentColor;
    overflow: hidden;
  }

  .designer    {width: 190px;margin:-10px -10px 0 0;}
</style>

